import { http } from '@/utils/http/axios';

export function listMaterial(data = {}) {
  return http.request({
    url: '/admin/base/material/list',
    method: 'get',
    data,
  });
}

export function pageMaterial(data = {}) {
  return http.request({
    url: '/admin/base/material/page',
    method: 'post',
    data,
  });
}

export function addMaterial(data = {}) {
  return http.request({
    url: '/admin/base/material/add',
    method: 'post',
    data,
  });
}

export function updateMaterial(data = {}) {
  return http.request({
    url: '/admin/base/material/update',
    method: 'post',
    data,
  });
}

export function delMaterial(data = {}) {
  return http.request({
    url: '/admin/base/material/delete',
    method: 'post',
    data,
  });
}

export function cloumsMaterial(data = {}) {
  return http.request({
    url: '/admin/base/material/cloums',
    method: 'get',
    data,
  });
}

export function saveParameterByMaterialVersion(data = {}) {
  return http.request({
    url: '/admin/base/material/saveParameterByMaterialVersion',
    method: 'post',
    data,
  });
}

export function getParameterByMaterialVersion(data = {}) {
  return http.request({
    url: '/admin/base/material/getParameterByMaterialVersion',
    method: 'post',
    data,
  });
}

export function saveParameterUnitByMaterialVersion(data = {}) {
  return http.request({
    url: '/admin/base/material/saveParameterUnitByMaterialVersion',
    method: 'post',
    data,
  });
}

export function getParameterUnitByMaterialVersion(data = {}) {
  return http.request({
    url: '/admin/base/material/getParameterUnitByMaterialVersion',
    method: 'post',
    data,
  });
}

export function exportMaterial(data) {
  return http.request({
    url: '/admin/base/material/export',
    method: 'post',
    data,
    responseType: 'blob',
  });
}
